﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using Pahan.McuFusion.Common;
using Pahan.McuFusion.UI.ComponentModel;

namespace Pahan.McuFusion.UI.Workspaces
{
    public partial class Workspace
    {
        private class Options
        {
            internal Options(Workspace workspace)
            {
                this.workspace = workspace;
            }

            [Category("Programmer")]
            [TypeConverter(typeof(IProgrammerConverter))]
            public IProgrammer Programmer
            {
                get
                {
                    return workspace.Programmer;
                }
            }

            [Category("Device")]
            [TypeConverter(typeof(McuInfoConverter))]
            public DeviceInfo Device
            {
                get
                {
                    return workspace.DeviceInfo;
                }
            }

            [DisplayName("Protocol Adapter")]
            [Category("Protocol Adapter")]
            [TypeConverter(typeof(IHardwareAdapterConverter))]
            public IHardwareAdapter Adapter
            {
                get
                {
                    return workspace.adapter;
                }
            }

            [DisplayName("Hardware Interface")]
            [Category("Hardware Interface")]
            [TypeConverter(typeof(IHardwareInterfaceConverter))]
            public IHardwareInterface Interface
            {
                get
                {
                    return workspace.hwInterface;
                }
            }

            private readonly Workspace workspace;
        }
    }
}